home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17426 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: pangea.Stanford.EDU!karish
  2. From: karish@pangea.Stanford.EDU (Chuck Karish)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
  4. Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
  5. Date: 15 Apr 1996 20:36:38 GMT
  6. Organization: Mindcraft, Inc.
  7. Message-ID: <4kuc0m$398@nntp.Stanford.EDU>
  8. References: <JSA.96Feb16135027@organon.com> <dewar.829399701@schonberg> <4kpceq$e4b@solutions.solon.com> <dewar.829446681@schonberg>
  9. NNTP-Posting-Host: pangea.stanford.edu
  10.  
  11. In article <dewar.829446681@schonberg>, Robert Dewar <dewar@cs.nyu.edu> wrote:
  12. >On the other hand, that same book says
  13. >that unlink is implemented in all systems, so clearly at least for the 
  14. >moment unlink is safer to use if you are aiming at maximum portability.
  15. >Rememerb that gcc is targeted to more than 300 different C library
  16. >environments, and you want to absolutely minimize conditional stuff.
  17. >That's what I meant by having a strenuous view of portability. I would
  18. >rather guess that Peter is pretty Unix oriented, and of course we are
  19. >trying for a wider scope of portability than Unix!
  20.  
  21. But unlink() is a UNIX system call that was also implemented in
  22. many other environments.  unlink() on UNIX and POSIX systems is
  23. only guaranteed to work if the argument is the name of a
  24. regular file; on many systems, unlink() fails for directories.
  25.  
  26. The rationale for ANSI C says that remove() was meant to be
  27. a generalized re-casting of the unlink() functionality, free of
  28. UNIX filesystem terminology ("link").  Implementations of remove()
  29. are allowed (but not required!) to do the right thing no matter
  30. what type of file they're used on.
  31. --
  32.  
  33.     Chuck Karish          karish@mindcraft.com
  34.     (415) 323-9000 x117   karish@pangea.stanford.edu
  35.